package day15;
import java.util.*;
/**
 * @author oldliu
 * @since 1.0
 */
public class ThreadTest {
    public static void main(String[] args) {
        Runnable r=new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i <20; i++) {
                    System.out.println(Thread.currentThread().getName()+" "+i);
                }
            }
        };
        new Thread(r,"线程-2").start();

        Thread th=new Thread("线程-1"){
            @Override
            public void run() {
                for (int i = 1; i <= 20; i++) {
                    System.out.println(super.getName()+" print "+i);
                }

            }
        };
        th.start();
        System.out.println(Thread.currentThread().getName()+"这是主线程");
    }
}
